{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}

<div class="col-md-2">
  <p class="text-left text-uppercase"><strong>{{heading}}</strong></p>
  <p class="text-left text-muted"><small>{{subHeading}}</small></p>
</div>
<div class="col-md-9">
  <div class="input-group input-group-lg">
    {{#unless extendDrawer }}
      {{input type="text" class="form-control display" value=selectedDatabase.name}}
    {{else}}
      {{input type="text" class="form-control search" value=filterText placeholder="Search Databases"}}
    {{/unless}}

    {{#if enableSecondaryAction}}
      <div class="input-group-btn">
        <button type="button" class="btn btn-default {{if extendDrawer 'active'}}" {{action 'secondaryActionClicked'}}>{{fa-icon secondaryActionFaIcon}} {{secondaryActionText}} <span class="caret"></span></button>
      </div>
    {{/if}}
  </div>
  {{#if extendDrawer }}
    <div class="database-search-drawer">
      <div class="list-group">
        {{#each filteredDatabases as |database|}}
            <a {{action "databaseClicked" database}} class="list-group-item {{if database.selected 'selected'}}">
              {{#if database.selected}}
                <div class="pull-right">
                  {{fa-icon "check" size="lg"}}
                </div>
              {{/if}}

              &nbsp;&nbsp;
              {{fa-icon "database" size="lg"}}&nbsp;&nbsp;{{database.name}}
            </a>
        {{/each}}
      </div>

    </div>
  {{/if}}
</div>
{{yield}}